package httpServer;
/**
 * Enum to define status condition for an HTTP response
 * 
 * @author Rebecca Chandler, Scott Wendlandt, and Li Weihan
 *
 */
public enum Status{
	BAD_REQUEST(400,"Bad Request"),
	NOT_FOUND(404,"Not Found"),
	HTTP_VERSION(505,"HTTP Version Not Supported"),
	OK(200,"OK"),
	TIMEOUT(408,"Request Timeout"), //The client did not produce a request within the time that the server was prepared to wait
	INTERNAL_ERR(500,"Internal Server Error"), //The server encountered an unexpected condition which prevented it from fulfilling the request.
	NOT_IMPLEMENTED(501,"Not Implemented"), //The server does not support the functionality required to fulfill the request
	PENDING(0,""),
	REQUEST_TIMEOUT(408, "Request Timeout");
	
	private int code;
	private String message;
	
	private Status (int c, String m) {
		code = c;
		message = m;
	}
	
	public int getCode(){
		return code;
	}
	
	public String getMessage(){
		return message;
	}
	
	/**
	 * Returns the status in the format: status code# + <space> + status message
	 * 
	 */
	public String toString(){
		return ("" + code + " " + message);
	}
}